/*
 * OpenNIConfiguration.h
 *
 *  Created on: Jun 23, 2011
 *      Author: sebastien
 */

#ifndef OPENNICONFIGURATION_H_
#define OPENNICONFIGURATION_H_
#include "Controller.h"
#include "../Model/Model.h"
#define CONFIG_XML_PATH "Data/Config.xml"
#define POSE_TO_USE "Psi"
extern xn::UserGenerator g_UserGenerator;
extern XnStatus nRetVal;
extern xn::Context context;
extern XnCallbackHandle h1, h2, h3;

extern int checkErrorCounter;

inline void checkErrorCode (XnStatus nRetVal,const char* testName) {
	checkErrorCounter++;
	if (nRetVal != XN_STATUS_OK) {
		printf("Failed check %s %d: %s\n", testName,
				checkErrorCounter, xnGetStatusString(nRetVal));
	}
//	else printf("Ok\n");
}
void XN_CALLBACK_TYPE User_NewUser(xn::UserGenerator& generator, XnUserID nId, void* pCookie);
void XN_CALLBACK_TYPE User_LostUser(xn::UserGenerator& generator, XnUserID nId, void* pCookie);
void XN_CALLBACK_TYPE Pose_Detected(xn::PoseDetectionCapability& pose, const XnChar* strPose,
		XnUserID nId, void* pCookie);
void XN_CALLBACK_TYPE Calibration_Start(xn::SkeletonCapability& capability, XnUserID nId, void* pCookie);

void XN_CALLBACK_TYPE Calibration_End(xn::SkeletonCapability& capability, XnUserID nId,
		XnBool bSuccess, void* pCookie);

void initOpenNIConfiguration();
void shutdownOpenNIConfiguration();

#endif /* OPENNICONFIGURATION_H_ */
